home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 118_01.zip / ECHO.BDS < prev    next >
Text File  |  1993-06-03  |  512b  |  27 lines

  1. /* echo command line arguments
  2.  * source:  echo.bds
  3.  * version: July 17, 1981
  4.  */
  5.  
  6. /* echo - echo command line arguments */
  7.  
  8.       #   include symbol definitions
  9.  
  10. DRIVER(echo)
  11.  
  12.     integer i
  13.     integer getarg
  14.  
  15.     character buf (MAXARG)
  16.  
  17.     call query ("usage:  echo [args].")
  18.  
  19.     for (i = 1; getarg (i, buf, MAXARG) != EOF; i = i + 1) {
  20.         if (i != 1)
  21.             call putch (BLANK, STDOUT)
  22.         call putlin (buf, STDOUT)
  23.         }
  24.     if (i != 1)
  25.         call putch (NEWLINE, STDOUT)
  26. }
  27.